package com.example.seleniumautotest.controller;

import lombok.extern.slf4j.Slf4j;
import org.openqa.selenium.chrome.ChromeDriver;
import org.springframework.stereotype.Component;

import java.util.Objects;

/*
* 自定义相关操作方法
* */

@Component
@Slf4j
public class CustomMethod {

    // 关闭driver
    public void closeDriver(ChromeDriver chromeDriver){
        if (Objects.nonNull(chromeDriver)){
            chromeDriver.quit();
        }else {
            log.info("关闭driver失败，chromeDriver为空！");
        }
    }
}
